<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Commodity_classify;

/**
 * Class HomeController
 * @package App\Http\Controllers\Home
 * @User wuqin
 * @Date 2018/4/13 0013
 * @Time 11:35
 */
class HomeController extends Controller
{
    /**
     * 方法 : index
     * @User wuqin
     * @DateTime 2018-04-13 11:35
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index()
    {
        $user = session('user_info');
        if (empty($user))
            return $this->error_url('/', '请重新登录', 3);
        $classify = new Commodity_classify;
        $data = [
            'user' => $user,
            'classify' => $classify->get_classify()
        ];
        $data["commodity"] = $this->index_data();
        $data["banner"] = $this->index_banner();
        return view('Home.index', $data);
    }

    /**
     * 方法 : license
     * @User wuqin
     * @DateTime 2018-04-13 11:35
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function license()
    {
        return view("Home.license");
    }
}
